Skip to content

GH-6792: Add headers mapping to JMS channels#10837

Closed
artembilan wants to merge 1 commit into
mainfrom
GH-6792
Closed

GH-6792: Add headers mapping to JMS channels#10837
artembilan wants to merge 1 commit into
mainfrom
GH-6792

Conversation

@artembilan

Copy link
Copy Markdown
Member

Fixes: #6792

Currently, by default AbstractJmsChannel implementations use Java serialization for storing Message<?> instance into JMS destination. The deserialized message is produced from the channel as is. There might be use-cases when some JMS properties could be useful in downstream flows.

  • Add DefaultJmsHeaderMapper into the AbstractJmsChannel as a conditional logic to map headers to/from JMS when jmsTemplate.getMessageConverter() is not a MessagingMessageConverter. Otherwise, then conversion of the message and header mapping is done in that converter
  • Refactor logic in the AbstractJmsChannel to common API
  • Fix Nullability formatting in the PollableJmsChannel
  • Use lambda style for MessageListener in the SubscribableJmsChannel instead of inner extra class
  • Ensure in the PollableJmsChannelTests and SubscribableJmsChannelTests that header mapper does it job
  • Fix JmsChannelParserTests to not assert on the messageBuilderFactory since now a MessageListener in the SubscribableJmsChannel is a direct method of the class
  • Fix JmsChannelHistoryTests verification according to a new internal logic of the AbstractJmsChannel
  • Document new feature in the jms.adoc and whats-new.adoc

Fixes: #6792

Currently, by default `AbstractJmsChannel` implementations use Java serialization
for storing `Message<?>` instance into JMS destination.
The deserialized message is produced from the channel as is.
There might be use-cases when some JMS properties could be useful in downstream flows.

* Add `DefaultJmsHeaderMapper` into the `AbstractJmsChannel` as a conditional logic
to map headers to/from JMS when `jmsTemplate.getMessageConverter()` is not a `MessagingMessageConverter`.
Otherwise, then conversion of the message and header mapping is done in that converter
* Refactor logic in the `AbstractJmsChannel` to common API
* Fix Nullability formatting in the `PollableJmsChannel`
* Use lambda style for `MessageListener` in the `SubscribableJmsChannel`
instead of inner extra class
* Ensure in the `PollableJmsChannelTests` and `SubscribableJmsChannelTests`
that header mapper does it job
* Fix `JmsChannelParserTests` to not assert on the `messageBuilderFactory`
since now a `MessageListener` in the `SubscribableJmsChannel` is a direct method of the class
* Fix `JmsChannelHistoryTests` verification according to a new internal logic of the `AbstractJmsChannel`
* Document new feature in the `jms.adoc` and `whats-new.adoc`
@artembilan artembilan requested a review from cppwfs February 26, 2026 17:39
@artembilan artembilan closed this Feb 26, 2026
@artembilan artembilan deleted the GH-6792 branch February 27, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add header-mapper to int-jms:channel [INT-2816]

1 participant